package com.example.demo.web

import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.multipart.MultipartFile
import java.nio.charset.Charset

@RestController
@RequestMapping("/device/test")
class PowerBankTestDataUP(
) {
    @RequestMapping("/setOrder")
    fun setOrder(@RequestBody order:String){
        PowerBankDeviceInterface.orderStr=order
    }
    @RequestMapping("/setUpdateFile")
    fun setUpFile(fileName:String,file:MultipartFile){
        PowerBankDeviceInterface.upfilecontent=file.bytes.toString(Charset.forName("utf-8"))
        PowerBankDeviceInterface.upfilename= file.originalFilename
    }


}

